#ifndef _BLURSHADER_H_
#define _BLURSHADER_H_

#include <d3d10.h>
#include <d3dx10math.h>
#include <fstream>
#include <string>
using namespace std;

/*************************************
* Class which provides help functions
* for setting up a shader onto our
* Bitmap Sprites and Texture Objects
* so we can integrate with the programmable
* pipeline.
*
* AUTHOR:  CHRIS CARTER
*************************************/
class CBlurShader
{
	public:
		//-------------CONSTRUCTORS/DESTRUCTORS-------------------------------------
		CBlurShader();
		~CBlurShader();

		//-------------PUBLIC METHODS-----------------------------------------------
		bool initialise(ID3D10Device* pdevice,std::wstring pshaderlocation);
		void cleanup();
		void render(int pindexcount, D3DXMATRIX pmatworld, D3DXMATRIX pmatview,
					D3DXMATRIX pmatproj, ID3D10ShaderResourceView* ptexsrv, float screenWidth, float screenHeight);

	protected:
		//-------------INTERNAL METHODS---------------------------------------------
		void internSetShaderParams(D3DXMATRIX pmatworld, D3DXMATRIX pmatview, D3DXMATRIX pmatproj,
									ID3D10ShaderResourceView* ptexsrv, float screenWidth, float screenHeight);
		void internRenderShader(int poffset);

	protected:
		//-------------INTERNAL FIELD MEMBERS---------------------------------------
		ID3D10Effect*							_obj_effect;
		ID3D10Device*							_obj_device;
		std::wstring							_prop_shaderloc;
		ID3D10EffectTechnique*					_obj_technique;
		ID3D10InputLayout*						_obj_layout;
		ID3D10EffectMatrixVariable*				_ptr_mat_world;
		ID3D10EffectMatrixVariable*				_ptr_mat_view;
		ID3D10EffectMatrixVariable*				_ptr_mat_proj;
		ID3D10EffectShaderResourceVariable*		_ptr_tex_res;

		// Get Screen Width and Height
		ID3D10EffectScalarVariable*	_ptr_sWidth;
		ID3D10EffectScalarVariable*	_ptr_sHeight;
};

#endif